<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="../js/jquery-3.2.1.min.js"></script>
    <style>
        .siblings * {
            display: block;
            border: 2px solid lightgrey;
            color: lightgrey;
            padding: 5px;
            margin: 15px;
        }
    </style>
</head>
<body class="siblings">
    <div>div (父元素)
        <p>p</p>
        <span>span</span>
        <h2>h2</h2>
        <h3>h3</h3>
        <p>p</p>
    </div>

    <script>
        $(function () {
            $('h2').siblings().css({"color":"red","border":"2px solid red"});
            $('h2').siblings('p').css({"color":"green","border":"2px solid green"});
            $('h2').next().css({"color":"blue","border":"2px solid blue"});
        })
    </script>
</body>
</html>